package com.hsogoo.study.spring.resource;

import org.junit.Test;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;

/**
 * Created by za-huangsaigang on 2018/9/17.
 */
public class ResourceLoaderTest {

    @Test
    public void testResourceLoader(){
        ResourceLoader loader = new DefaultResourceLoader();

        Resource resource1 = loader.getResource("/application.properties");
        System.out.println(resource1.getClass());

        Resource resource2 = loader.getResource("classpath:application.properties");
        System.out.println(resource2.getClass());

        Resource resource3 = loader.getResource("http://www.baidu.com");
        System.out.println(resource3.getClass());

        Resource resource4 = loader.getResource("hsogoo");
        System.out.println(resource4.getClass());

    }

}
